import request from '@/utils/request'

// 获取学生的错题本列表
export function getStudentMistakes(studentId) {
  return request({
    url: `/api/mistake-book/student/${studentId}`,
    method: 'get'
  })
}

// 从错题本中删除题目
export function deleteMistake(mistakeId) {
  return request({
    url: `/api/mistake-book/${mistakeId}`,
    method: 'delete'
  })
}

// 更新错题记录
export function updateMistake(mistakeId, data) {
  return request({
    url: `/api/mistake-book/${mistakeId}`,
    method: 'put',
    data
  })
}

// 更新重做次数
export function updateRetryCount(mistakeId, isCorrect) {
  return request({
    url: `/api/mistake-book/${mistakeId}/retry`,
    method: 'put',
    params: { isCorrect }
  })
}

// 获取错题知识点统计
export function getKnowledgeStats(studentId) {
  return request({
    url: `/api/mistake-book/student/${studentId}/knowledge-stats`,
    method: 'get'
  })
} 